<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 
        如果父亲没有定位就会去找爷爷，太爷爷 如果都没有那么会以浏览器进行定位
        绝对定位会脱离文档流
         */
        .father {
            width: 300px;
            height: 300px;
            background-color: pink;
            margin: 100px;
            position: relative;
        }

        .son {
            width: 100px;
            height: 100px;
            background-color: purple;
            position: absolute;
            left: 15px;
            top: 15px;
        }
    </style>
</head>

<body>
    <div class="father">
        <div class="son"></div>
    </div>


    </div>
</body>

</html>